@extends('admin.app')

@section('content')
  <div class="panel panel-default">
    <div class="panel-heading font-bold">交易记录</div>
    <div class="panel-body">
      <div class="table-responsive">
        <table class="table table-striped b-t b-light">
          <thead>
            <tr>
              <th>交易流水号</th>
              <th>交易类型</th>
              <th>付款人</th>
              <th>收款人</th>
              <th>交易金额</th>
              <th>状态</th>
              <th>备注</th>
              <th>创建时间</th>
              <th>付款时间</th>
              <th>结束时间</th>
              <th></th>
            </tr>
          </thead>
          <tbody>
          @forelse ($trades as $trade)
            <tr>
              <td>{{$trade->sn}}</td>
              <td>{{$trade->assignType()}}</td>
              <td>{{$trade->pay_user}}</td>
              <td>{{$trade->receive_user}}</td>
              <td>{{$trade->money}}</td>
              <td>{{$trade->status}}</td>
              <td>{{$trade->remarks}}</td>
              <td>{{$trade->created_at}}</td>
              <td>{{$trade->pay_time}}</td>
              <td>{{$trade->end_time}}</td>
              <td>
                <a href="{{admin_action('Business\DemandController@checkTrade',[$trade->id])}}" class="btn btn-xs btn-danger">检查</a>
              </td>
            </tr>
            @empty
            <tr>
              <td colspan="10" class="text-center">没有找到交易记录</td>
            </tr>
            @endforelse
          </tbody>
        </table>
      </div>
    </div>
    <div class="panel-footer">
      <div class="row">
        <div class="col-sm-12 text-right text-center-xs">                
          {{ $links }}
        </div>
      </div>
    </div>
  </div>
@endsection